//
//  SUCCESSViewController.m
//  HQJFacilitator
//
//  Created by mymac on 2016/10/12.
//  Copyright © 2016年 Fujian first time iot technology investment co., LTD. All rights reserved.
//

#import "SUCCESSViewController.h"

@interface SUCCESSViewController ()

@end

@implementation SUCCESSViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self createUI];
    [self navBackBtn];
    self.fd_interactivePopDisabled = YES;
    // Do any additional setup after loading the view.
}
-(void)createUI {
    UIImageView *imageView = [[UIImageView alloc]init];
//    imageView.backgroundColor = [UIColor redColor];
    [self.view addSubview:imageView];
    imageView.layer.masksToBounds = YES;
    imageView.layer.cornerRadius = 25;
    imageView.image = [UIImage imageNamed:@"registered_succeed"];
    imageView.sd_layout.leftSpaceToView(self.view,self.view.center.x-50/2).topSpaceToView(self.view,self.view.center.y-100).heightIs(50).widthIs(50);
    UILabel *label = [[UILabel alloc]init];
    [self.view addSubview:label];
    label.font = [UIFont systemFontOfSize:21];
    label.text = @"恭喜你注册成功!";
//    label.backgroundColor = [UIColor blueColor];
    label.textAlignment  =NSTextAlignmentCenter;
    label.sd_layout.leftSpaceToView(self.view,0).topSpaceToView(imageView,15).heightIs(25).widthIs(WIDTH);
    
    
}
#pragma mark --
#pragma mark --- 返回按钮
-(void)navBackBtn {
    
    //自定义左边 的按钮
    UIButton *leftButton = [[UIButton alloc]init];
    leftButton.frame = CGRectMake(0, 0, 20, 20);
    [leftButton setBackgroundImage:[UIImage imageNamed:@"ARROW---LEFT"] forState:UIControlStateNormal];
   [leftButton bk_addEventHandler:^(id  _Nonnull sender) {
       [self.navigationController popToRootViewControllerAnimated:YES];

   } forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *leftBarButtonItems = [[UIBarButtonItem alloc]initWithCustomView:leftButton];
    self.navigationItem.leftBarButtonItem = leftBarButtonItems;
    //解决按钮不靠左 靠右的问题.
//    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
//    nagetiveSpacer.width = 10;//这个值可以根据自己需要自己调整
//    self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftBarButtonItems];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
